/**
 * @param {number} num
 * @return {string}
 */
//LeetCode第一个评论大佬写的。
let intToRoman = function(num) {
    let values = [1000,900,500,400,100,90,50,40,10,9,5,4,1]
    let romaStr = ["M","CM","D","CD","C","XC","L","XL","X","IX","V","IV","I"]
    let res = ""
    for(let i = 0; i < values.length; i++){
     while(num >= values[i]){
         num -= values[i]
         res += romaStr[i]
     }   
    }
    return res
}